#ifndef PWMS_H_
#define PWMS_H_

/* PWM Positioning */
#define PWM_MIN             900000
#define PWM_CENTRE          925000
#define PWM_MAX             950000

#define PWM_CLOCK_DIV       1000000

#define PWM_INC             300
#define PWM_DEC             (-300)

/* Internal PWM IDs */
#define PWM_COUNT           6
#define PWM_ID_ROTATE       0
#define PWM_ID_SHOULDER     1
#define PWM_ID_ELBOW        2
#define PWM_ID_GRIPPER      3
#define PWM_ID_WRISTTWIST   4
#define PWM_ID_WRISTBEND    5

/* Functions */
int InitialisePWMs(void);
int EnablePWMs(void);
int DisablePWMs(void);
int EnablePWM(unsigned int pwm);
int DisablePWM(unsigned int pwm);



void SendValueToPWM(unsigned int pwm, unsigned long value);
void IncPWM(unsigned int pwm, unsigned short value);
void DecPWM(unsigned int pwm, unsigned short value);

void CentrePWM(unsigned int pwm);
void CentrePWMs(void);
void HomePWMs(void);

void TestPWMs(void);

void InvertGripperPWM(void);

#endif /*PWMS_H_*/
